package com.example.helloworld;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.res.ResourcesCompat;

public class TextviewActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.textview_test);
        TextView textView = findViewById(R.id.tv01);
        Drawable drawable1 = ResourcesCompat.getDrawable(getResources(), R.mipmap.wo, null);
        if (drawable1 != null) {
            drawable1.setBounds(0,0,80,80);
        }
        textView.setCompoundDrawables(null , drawable1, null, null);
    }
}